<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="asserts/js/jquery-2.1.1.min.js"></script>
  <script type="text/javascript">
    $(function () {
      $("#subBtn").click(function () {
          let formData = new FormData();
          formData.append("file",$("#file_upload")[0].files[0]);
        $.ajax({
            url: '/taobei_web/user/upload',
            type: 'post',
            data: formData,
            dataType: 'json',
            contentType : false,
            processData: false,
            success(data) {
                $("#img_1").attr("src",data.msg)
                console.log(data.msg)
            }
        })
      })
    })
  </script>
</head>
<body>
  <input type="file" id="file_upload" value="文件上传">
  <input type="button" value="上传" id="subBtn">
  <img id="img_1" src=""/>
</body>
</html>